#!/bin/bash

if [ -z $1 ];then 
	read -p "Input Max Int Lines:" MAX
else
	MAX=$1
fi

[ -n "`echo $MAX|sed 's/[0-9]//g'`" ] && \
echo "you input not a int!" && exit 1

[ $MAX -ge 10 ] && echo "you input number < 10!" && exit 1

a[0]=1
for((i=0;i<=MAX;i++))
do
	for((j=$i;j>0;j--))
	do
		((a[$j]+=a[$j-1]))
	done
	
	for((j=0;j<$[MAX-$i];j++))
	do
		if [ $MAX -le 10 ];then
			echo -en "\t"
		else
			echo -n " "
		fi
	done
	
	for((j=0;j<$i;j++))
	do
		if [ $MAX -lt 10 ];then
			echo -en "\t\t"${a[${j}]}
		else
			echo -n ${a[$j]}
		fi
	done
echo
done